package com.itszt.common;

public class PicUrlUtil {

    public static String genGroupPath(String imgUrls,String nginxUrl){

        StringBuilder stringBuilder = new StringBuilder();
        String[] split = imgUrls.split(",");
        for (String s : split) {
            String replace = s.replace(nginxUrl, "");
            stringBuilder.append(replace);
            stringBuilder.append(",");
        }
        String result = stringBuilder.toString();
       return result.substring(0,result.length()-1);
    }

    public static String genFullPath(String imgUrls,String nginxUrl){

        StringBuilder stringBuilder = new StringBuilder();
        String[] split = imgUrls.split(",");
        for (String s : split) {
            String replace = nginxUrl+s;
            stringBuilder.append(replace);
            stringBuilder.append(",");
        }
        String result = stringBuilder.toString();
        return result.substring(0,result.length()-1);
    }
}
